package com.sdd.rpi_mobile.resourceLists;

import android.content.Context;
import android.util.Log;

import com.sdd.rpi_mobile.R;

/** Factory to create the appropriate ListViewLoader object */
public class ListFactory 
{
	/**
	 * Decides which ListViewLoader based on the resource id
	 * @param context
	 * Context of calling activity
	 * @param resId
	 * Resource ID
	 * @return Appropriate ListViewLoader
	 */
	public static ListViewLoader newList(Context context, int resId) {
		if(R.array.campus_navigation == resId) {
			return new ListListLoader(context);
		}
		else if(R.array.academic_buildings == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.residential_buildings == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.administrative_buildings == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.campus_dining == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.student_life == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.other == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.place_of_interest == resId)	{
			return new ListListLoader(context);		
		}
		else if(R.array.food == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.shopping == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.entertainment == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.useful_info == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.troy_in == resId) {
			return new ListItemLoader(context);
		}
		else if(R.array.troy_out == resId) {
			return new ListItemLoader(context);
		}
		else {
			Log.e("Custom error", "Error in ListFactory, noooo!!");
		}		
		return null;
	}
}
